package demo1;

import entity.User;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-04-24
 * Time: 9:24
 */
@Component
public class BeanUser {
    @Bean(name = "User2")
    public User user1() {
        User user = new User();
        user.setUsername("zhangsan");
        user.setId(1);
        user.setAge(19);
        return user;
    }
}
